package com.xpec.net;

public abstract class NetFuture {

	/**
	 * Returns true if and only if this future is complete,
	 * regardless of whether the operation was successful, failed, or cancelled.
	 */
	public abstract boolean isDone();
	
	/**
	 * Returns true if and only if the I/O operation was completed successfully.
	 */
	public abstract boolean isSuccess();

	/**
	 * Returns true if and only if this future was cancelled by a cancel() method.
	 */
	public abstract boolean isCancelled();

	
	/**
	 *  Returns the cause of the failed I/O operation
	 *  if the I/O operation has failed.
	 */
	public abstract Throwable getCause();

	/**
	 * Cancels the I/O operation associated with this future
	 * and notifies all listeners if canceled successfully.
	 */
	public abstract boolean cancel();
}
